import {
	Watch
} from '../../ways/watch.js'
export default {
	props: {
		isOpenPattern: { //是否开启黑白模式
			type: Boolean,
			default: true
		},
		ggclass: { //盒子类名
			type: [String, Array],
			default: () => [],
		},
		dark: {
			type: String,
			default: '',
		},
		light: {
			type: String,
			default: ''
		},
		color: {
			type: String,
			default: ''
		},
		background: {
			type: String,
			default: ''
		}

	},
	data() {
		return {
			patterns: new Watch(this.$color),

		}
	},
	computed: {
		isDark() {
			// console.log(this.patterns.proxy,'proxy')
			return this.patterns.proxy.themeKey === 'dark'
		},
		computedColor() {
			if (this.isOpenPattern) {
				return this.$color.theme.textColor
			}
			// return this.color || this.$color.theme.textColor
			return this.color || '#333'
		},

		computedBackground() {
			if (this.background.includes("data") || this.background.includes("http")) {
				return `url(${this.background})`;
			}
			if (this.isOpenPattern) {
				return this.$color.theme.background
			}
			return this.background || this.$color.theme.background
		},
	},
}
